﻿/******************************************************************************
  * Copyright  2023 - LiuKuan
  * All right reserved. See COPYRIGHT for detailed Information.
  *
  * @file       SerialDebugger.h
  * @brief      串口调试界面逻辑
  * @author     <807874484@qq.com>
  * @date       2024/10/17
  * @history
  *****************************************************************************/

#ifndef SERIALDEBUGGER_H
#define SERIALDEBUGGER_H


#include <QObject>
#include <QMap>
#include <QSettings>
#include <QDebug>

#include "comm/Linkinterface.h"

class SerialDebugger : public QObject
{
    Q_OBJECT
public:
    explicit SerialDebugger(const QString & file_name , QObject *parent = nullptr);

    /// \brief 使能保存串口数据到日志
    /// \param file_path
    /// \return
    ///
    bool enableSaveLogToFile(bool enbale);
signals:
    void msgInfo(QString msg);
    void recvSerialMsgSig(const QString & str);
public slots:
    void recvSerialMsg(LinkInterface* link,const QByteArray bytes);
private:
    bool isEnableSaveTofile_ = false;
    QMap<QString,QString> settings_map_;

};

#endif // SERIALDEBUGGER_H
